$('#regiBtn').bind('click', function(e) {

    // Prevents the default action to be triggered. 
    e.preventDefault();

    // Triggering bPopup when click event is fired
    $('#regiPopup').bPopup();

});


$('#atdBtn').bind('click', function(e) {

    // Prevents the default action to be triggered. 
    e.preventDefault();

    // Triggering bPopup when click event is fired
    $('#atdPopup').bPopup();

});


$('#RevBtn').bind('click', function(e) {

    // Prevents the default action to be triggered. 
    e.preventDefault();

    // Triggering bPopup when click event is fired
    $('#RevPopup').bPopup();

});




$(document).ready(function(){
	$("#regiSubmit").click(function(){
		var name = $("#regi_name").val();
		var birth = $("#regi_birth").val();
		var school = $("#regi_school").val();
		var telephone = $("#regi_telephone").val();
		var email = $("#regi_email").val();
		
		if(name=="" || name==null){

    		$("#regi_message").fadeIn(callback);
    		
    		 function callback() {

    		      setTimeout(function() {

    		        $("#regi_message").fadeOut();

    		      }, 1000 );

    		    };
			return false;
		}
		
		$.ajax({
	        url:'regi_proc.jsp',
	        type:'POST',
	        data:{name:name,birth:birth,school:school,telephone:telephone,email:email},
	        success:function(data){
	        	
	        	var options = { to:"#regiSubmit", className: "ui-effects-transfer" };
	        	$("#regiPopup").effect("transfer", options, 500, setTimeout(function(){$(".inputBox").val("");},1000));	//효과이름, 옵션, 시간, 콜백함수.
	        }
	        	
	    });
		
	});
	
});



